package com.ruoyi.merchant.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.GroupBuyingMapper;
import com.ruoyi.merchant.domain.GroupBuying;
import com.ruoyi.merchant.service.IGroupBuyingService;

/**
 * 优惠团购Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-15
 */
@Service
public class GroupBuyingServiceImpl implements IGroupBuyingService 
{
    @Autowired
    private GroupBuyingMapper groupBuyingMapper;

    /**
     * 查询优惠团购
     * 
     * @param id 优惠团购主键
     * @return 优惠团购
     */
    @Override
    public GroupBuying selectGroupBuyingById(Integer id)
    {
        return groupBuyingMapper.selectGroupBuyingById(id);
    }

    /**
     * 查询优惠团购列表
     * 
     * @param groupBuying 优惠团购
     * @return 优惠团购
     */
    @Override
    public List<GroupBuying> selectGroupBuyingList(GroupBuying groupBuying)
    {
        return groupBuyingMapper.selectGroupBuyingList(groupBuying);
    }

    /**
     * 新增优惠团购
     * 
     * @param groupBuying 优惠团购
     * @return 结果
     */
    @Override
    public int insertGroupBuying(GroupBuying groupBuying)
    {
        return groupBuyingMapper.insertGroupBuying(groupBuying);
    }

    /**
     * 修改优惠团购
     * 
     * @param groupBuying 优惠团购
     * @return 结果
     */
    @Override
    public int updateGroupBuying(GroupBuying groupBuying)
    {
        return groupBuyingMapper.updateGroupBuying(groupBuying);
    }

    /**
     * 批量删除优惠团购
     * 
     * @param ids 需要删除的优惠团购主键
     * @return 结果
     */
    @Override
    public int deleteGroupBuyingByIds(Integer[] ids)
    {
        return groupBuyingMapper.deleteGroupBuyingByIds(ids);
    }

    /**
     * 删除优惠团购信息
     * 
     * @param id 优惠团购主键
     * @return 结果
     */
    @Override
    public int deleteGroupBuyingById(Integer id)
    {
        return groupBuyingMapper.deleteGroupBuyingById(id);
    }
}
